package com.yanqu.road.entity.kowloon.battle;

import com.yanqu.road.entity.kowloon.KowloonNpcAttributeData;
import com.yanqu.road.entity.kowloon.common.Vec2;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * 敌人数据
 */
public class KowloonBattleEnemyData {

    /**
     * 敌人唯一id
     */
    private long uniqueId;


    /**
     * 敌人类型
     */
    private int enemyId;

    /**
     * 出现时间
     */
    private int bornTime;

    /**
     * 行走路线
     */
    private LinkedList<Integer> walkRouteList = new LinkedList<>();

    /**
     * 路径
     */
    private LinkedList<Vec2> path = new LinkedList<>();

    /**
     * 最终造成的伤害，如果没走完就是0，用来验证和防错
     */
    private int damage;

    private KowloonNpcAttributeData attributeData = new KowloonNpcAttributeData();

    /**
     * 缩放比例
     */
    private int resourceSize;

    /**
     * 死后生成敌人，（需要带出来给客户端）
     */
    private List<KowloonBattleEnemyData> deadBornEnemyList = new ArrayList<>();

    /**
     * 减速、冰冻、眩晕buff间隔时间/ms（只要中任一效果，就进入冷却时间，受击后开始算
     */
    private List<Integer> buffCd = new ArrayList<>();

    public KowloonBattleEnemyData clone(){
        KowloonBattleEnemyData enemyData = new KowloonBattleEnemyData();
        enemyData.setUniqueId(this.uniqueId);
        enemyData.setEnemyId(this.enemyId);
        enemyData.setBornTime(this.bornTime);
        enemyData.setWalkRouteList(new LinkedList<>(walkRouteList));
        for (Vec2 vec2 : this.path) {
            enemyData.getPath().addLast(vec2.clone());
        }
        enemyData.setDamage(this.damage);
        enemyData.setAttributeData(this.attributeData.clone());
        enemyData.setResourceSize(this.resourceSize);
        for (KowloonBattleEnemyData data : deadBornEnemyList) {
            enemyData.getDeadBornEnemyList().add(data.clone());
        }
        if (this.buffCd != null) {
            enemyData.setBuffCd(new ArrayList<>(this.buffCd));
        }
        return enemyData;
    }

    public long getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(long uniqueId) {
        this.uniqueId = uniqueId;
    }

    public int getEnemyId() {
        return enemyId;
    }

    public void setEnemyId(int enemyId) {
        this.enemyId = enemyId;
    }

    public int getBornTime() {
        return bornTime;
    }

    public void setBornTime(int bornTime) {
        this.bornTime = bornTime;
    }

    public LinkedList<Vec2> getPath() {
        return path;
    }

    public void setPath(LinkedList<Vec2> path) {
        this.path = path;
    }

    public LinkedList<Integer> getWalkRouteList() {
        return walkRouteList;
    }

    public void setWalkRouteList(LinkedList<Integer> walkRouteList) {
        this.walkRouteList = walkRouteList;
    }

    public KowloonNpcAttributeData getAttributeData() {
        return attributeData;
    }

    public void setAttributeData(KowloonNpcAttributeData attributeData) {
        this.attributeData = attributeData;
    }

    public int getDamage() {
        return damage;
    }

    public void setDamage(int damage) {
        this.damage = damage;
    }

    public int getResourceSize() {
        return resourceSize;
    }

    public void setResourceSize(int resourceSize) {
        this.resourceSize = resourceSize;
    }

    public List<KowloonBattleEnemyData> getDeadBornEnemyList() {
        return deadBornEnemyList;
    }

    public void setDeadBornEnemyList(List<KowloonBattleEnemyData> deadBornEnemyList) {
        this.deadBornEnemyList = deadBornEnemyList;
    }

    public List<Integer> getBuffCd() {
        return buffCd;
    }

    public void setBuffCd(List<Integer> buffCd) {
        this.buffCd = buffCd;
    }
}
